<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width='device-width', initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Person{
            constructor(name,age){
                this.name = name;
                this.age = age;
                this.fun =function(){
                    console.log(this);//创建它的实例对象
                }
            }
            // Person自身上 静态方法
            static say(){
                console.log('该方法添加到Person上')
                console.log(this);//Person
            }
            // 添加到原型对象上
            jump(){
                console.log('该方法添加到原型对象上')
                console.log(this);//调用它的实例对象
            }
        }
        console.dir(Person);
        let hw = new Person('hw',18);
        console.log(hw);
        Person.say();
        hw.jump();
        hw.fun();
    </script>
</body>
</html>